#!/usr/bin/python3

a = 21
b = 10
c = 0

c = a + b
print("31 = 21 + 10 的值为：", c)

c += a
print("52 = 31 += 21 的值为：", c)

c *= a
print("1092 = 52 *= 21 的值为：", c)

c /= a
print("52 = 1092 /= 21 的值为：", c)

c = 10
c %= 3
print("1 = 10 %= 3 的值为：", c)

c = 2
c **= 3
print("2的3次方 幂赋值运算符：", c)

c = 11
c //= 2
print("11除以2向下取整 取整除赋值运算符：", c)

# 海象运算符，可在表达式内部为变量赋值。Python3.8 版本新增运算符。
aaa = "123456789123"
if (n := len(aaa)) > 10:
    print(f"List is too long ({n} elements, expected <= 10)")
